package cn.thinkcloud.corpwx.worksign.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import cn.thinkcloud.corpwx.worksign.component.ScheduledRunnable;

@Service
public class ScheduledExecutor {
    private Logger logger = LoggerFactory.getLogger(ScheduledExecutor.class);
    
    @Autowired
    ScheduledRunnable updateAccessTokenScheduledRunnable;

    @Scheduled(fixedDelay = 5000)        //fixedDelay = 5000表示当前方法执行完毕5000ms后，Spring scheduling会再次调用该方法
    public void testFixDelay() {
        updateAccessTokenScheduledRunnable.execute();
    }
}
